//
//  GRPersonOptionViewCell.m
//  YC_GRice
//
//  Created by LiuFeng on 2018/7/8.
//  Copyright © 2018年 YeCai. All rights reserved.
//

#import "GRPersonOptionViewCell.h"

@implementation GRPersonOptionViewCell

-(void)setModel:(GROptionModel *)model {
    if (model) {
        _optionIMG.image = [UIImage imageNamed:model.imgName];
        _optionName.text = model.optionName;
        
        if (model.badge > 0) {
            _optionBadge.hidden = NO;
            _optionBadge.text   = [NSString stringWithFormat:@"%ld",model.badge];
        }else {
            _optionBadge.hidden = YES;
        }
    }
    
    _optionName.hidden = model ? NO : YES;
    _optionIMG.hidden   = model ? NO : YES;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    [_optionBadge setAdjustsFontSizeToFitWidth:YES];
}

@end
